home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / Java2 / src / java / security / Guard.java < prev    next >
Encoding:
Java Source  |  1999-05-28  |  1.4 KB  |  47 lines  |  [TEXT/CWIE]

  1. /*
  2.  * @(#)Guard.java    1.6 98/06/29
  3.  *
  4.  * Copyright 1997, 1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.security;
  16.  
  17. /**
  18.  * <p> This interface represents a guard, which is an object that is used
  19.  * to protect access to another object.
  20.  *
  21.  * <p>This interface contains a single method, <code>checkGuard</code>,
  22.  * with a single <code>object</code> argument. <code>checkGuard</code> is
  23.  * invoked (by the GuardedObject <code>getObject</code> method)
  24.  * to determine whether or not to allow access to the object.
  25.  *
  26.  * @see GuardedObject
  27.  *
  28.  * @version 1.6 99/03/26
  29.  * @author Roland Schemers
  30.  * @author Li Gong
  31.  */
  32.  
  33. public interface Guard {
  34.  
  35.     /**
  36.      * Determines whether or not to allow access to the guarded object
  37.      * <code>object</code>. Returns silently if access is allowed.
  38.      * Otherwise, throws a SecurityException.
  39.      *
  40.      * @param object the object being protected by the guard.
  41.      *
  42.      * @exception SecurityException if access is denied.
  43.      *
  44.      */
  45.     void checkGuard(Object object) throws SecurityException;
  46. }
  47.